{% extends 'base.html' %}
{% block title %}首页{% endblock %}
{% block head %}
    <link rel="stylesheet" href="{{ url_for('static', filename='css/index.css') }}">
{% endblock %}
{% block main %}
    <div class="entertainment-news-area" >
        <h2 style="text-align: center;">新闻列表</h2>
    <hr>
    <ul>
        {% for new_one in context.items %}
            <li>
                <div class="avatar-group">
                    <img src="{{ url_for('static', filename='images/uestc.jpg') }}" alt="" class="avatar">
                </div>
                <div class="news-group">
                    <p class="news-title"><a
                            href="{{ url_for('news_detail', news_id = new_one.id) }}">{{ new_one.title }}</a></p>
                </div>
                <div class="news-info">
                    <span class="news-time">{{ new_one.create_time }}</span>
                </div>
            </li>
        {% endfor %}
    </ul>
    <nav aria-label="Page navigation" style="text-align: center">
        <ul class="pagination">
            <li>
                {% if context.has_prev %}
                <a href="{{ url_for('index', page = context.prev_num) }}" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
                {% else %}
                    <span aria-hidden="true">&laquo;</span>
                {% endif %}
            </li>
            <li><a href="{{ url_for('index', page = 1) }}">1</a></li>
            <li><a href="{{ url_for('index', page = 2) }}">2</a></li>
            <li><a href="{{ url_for('index', page = 3) }}">3</a></li>
            <li>
            {% if context.has_next %}
                <a href="{{ url_for('index', page = context.next_num) }}" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
                {% else %}
                    <span aria-hidden="true">&raquo;</span>
                {% endif %}
            </li>
        </ul>
    </nav>
    </div>
{% endblock %}
